#pragma once

#include "baseTypes.h"
#include <math3d.h>
#include <btBulletDynamicsCommon.h>
#include "Physics.h"

class Player
{
public:
	Player(void);
	~Player(void);

	void MoveForward(float_t argDeltaTime);
	void MoveBackward(float_t argDeltaTime);
	void MoveRight(float_t argDeltaTime);
	void MoveLeft(float_t argDeltaTime);
	void Jump(float_t argDeltaTime);
	void PlayJumpAnimation(float_t argDeltaTime);
	void Dash(float_t argDeltaTime);
	void UpdateDash(float_t argDeltaTime);
	float_t GetCacheX() const;

	void SetLookAt();
	void SetMode3D(bool8_t arg3D);

	void Update(float_t argDelta);
	void Draw() const;
	void Draw2D();
	void CacheOrigin();
	void ResetPlayer();
	void SetWinState();
	void ProcessInput(float_t argDeltaTime);
	ImpossiblePhysics::PhysicsObj*& GetPhysicsEntity();

private:
	void ResetTransform();
	void CheckDeath();

	// Player physics entity
	ImpossiblePhysics::PhysicsObj* m_physicsObject;
	M3DVector3f m_vOriginBottom;
	bool8_t m_bApplyTorque;
	bool8_t m_bDoubleJump;
	bool8_t m_bDashEnabled;
	bool8_t m_bStartPressed;
	bool8_t m_b2dEnabled;
	bool8_t m_bJumpAnimation;
	bool8_t m_bClearForceFlag;
	bool8_t m_bJumpRequested;
	bool8_t m_bWinState;
	float_t m_fJumpTimer;
	float_t m_fTotalRotation;
	float_t m_fDashTime;
	float_t m_fSpeed;
	float_t m_fCacheX;
	float_t m_fDeltaX;
	float_t m_fCacheY;
	float_t m_fDeltaY;
	float_t m_fDimensionOffset;
};

